package com.socket.serializableTest;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * SerialTest--bdqnPractice
 *
 * @author: Jovi
 * @createTime: 2017-09-07 17:34
 **/
public class SerialTest {

    public static void main(String[] args) {

        Person person = new Person(1, "jam",12);
        System.out.println("Person Serial :" + person);
        try {
            FileOutputStream fos = new FileOutputStream("people.txt");
            ObjectOutputStream oos = new ObjectOutputStream(fos);

            oos.writeObject(person);
            oos.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
